package parkshop.pmcourse.mapping;

import java.util.List;

import parkshop.pmcourse.domain.Product;
import parkshop.pmcourse.dto.PageBean;
public interface ProductMapper {

	Product selectByPrimaryKey(Long id);
	
	List<Product> selectAllProductsByType(PageBean pageBean);
	int selectAllProductCountByType(String type);
	
	List<Product> selectProductsByTypeAndShopId(PageBean pageBean);
	int selectProductCountByTypeAndShopId(PageBean pageBean);
	
	
	void insertProduct(Product product);
	int selectProductCount();
	List<Product> getProductsByPage(PageBean pageBean);// this is for mall administrator
	List<Product> getProductsPageByShopId(PageBean pageBean);// this is for shop owner
	int selectProductCountByShopId(Long shopId);
	
	List<Product> selectProductsByName(String name);
	List<Product> selectProductsPageByName(PageBean pageBean);//pageBean.type=name
	int selectProductsCountByName(String name);
	
	int deleteByPrimaryKey(Long id);
	int updateByPrimaryKeySelective(Product product);
	
	int deleteByShopId(Long shopId);
	
}
